/**
 * 
 */
package com.gosophia.orgManagement.action;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.commons.web.logAnnotation.LogRecord;
import com.gosophia.organizationManagement.dto.OrganizationDTO;
import com.gosophia.organizationManagement.ws.OrganizationManagementWebService;
import com.opensymphony.xwork2.ActionContext;

/**
 * 删除机构用action
 * @author wangxinbing,zhaoyan
 * @since  2010-12-31
 *  Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Controller("DeleteOrganizationAction")
@Scope("prototype")
public class DeleteOrganizationAction extends BaseSupportAction{

    private static final long serialVersionUID = 1L;
    private OrganizationDTO orgDTO;
    private List<OrganizationDTO> organizationDTOs;
    @Autowired
    private OrganizationManagementWebService organizationManagementWebService;
    @LogRecord(eventAction="机构管理-删除机构",eventTarget="orgDTO")
    @Override
    public String _execute()throws Exception{
        organizationDTOs = organizationManagementWebService.removeOrganization(orgDTO);
        super.getRequestResult().setRsltCode("0");
        super.getRequestResult().setMessage("机构删除成功");
        return SUCCESS;
    }

//    @Override
//    public RequestResult getRequestResult() {
//        return requestResult;
//    }

    public OrganizationDTO getOrgDTO() {
        return orgDTO;
    }

    public void setOrgDTO(OrganizationDTO orgDTO) {
        this.orgDTO = orgDTO;
    }
//
//    public OrganizationTreeDTO getOrgTreeDTO() {
//        return orgTreeDTO;
//    }
//
//    public void setOrgTreeDTO(OrganizationTreeDTO orgTreeDTO) {
//        this.orgTreeDTO = orgTreeDTO;
//    }

    public List<OrganizationDTO> getOrganizationDTOs() {
        return organizationDTOs;
    }

    public void setOrganizationDTOs(List<OrganizationDTO> organizationDTOs) {
        this.organizationDTOs = organizationDTOs;
    }
    
}
